﻿#include "wnd_dev_mng.h"


//#include "minigui_api.h"
#include <minigui/ctrl/static.h>
#include <minigui/ctrl/iconview.h>

#include <minigui/common.h>
#include <minigui/minigui.h>
#include <minigui/gdi.h>
#include <minigui/window.h>
#include <minigui/ctrl/button.h>
#include <minigui/ctrl/edit.h>
#include <minigui/ctrl/scrollview.h>
#include <minigui/ctrl/scrollbar.h>
#include <mgi/mgi.h>
#include "redis_msg_handle.h"
#include "redis_ctrl.h"
#include "wnd_set.h"
#include "wnd_handle.h"
#if 0

MINI_SET_MNG_WND_S stGlbSetMngWnd = {
	.s8MenuPath[0] = "share/res/png/dev_set/录像查询.png",
	.s8MenuPath[1] = "share/res/png/dev_set/状态查询.png",
	.s8MenuPath[2] = "share/res/png/dev_set/日志查询.png",
	.s8MenuPath[3] = "share/res/png/dev_set/设置.png",
	.s8MenuPath[4] = "share/res/png/dev_set/智能交通.png",
	.s8MenuPath[5] = "share/res/png/dev_set/注销.png",
	.s8MenuPath[6] = "share/res/png/dev_set/返回点击状态.png",
};


int MINI_SET_MNG_WNG_Switch(HWND hWnd, int s32Switch)
{
	switch(s32Switch) {
		case 0: {
			QLOG(TDBG ,"录像搜索\n");
			WND_API_CreateMainWnd(hWnd, WND_TYPE_VIDEO_SEARCH_E);
			break;
		}
		case 1: {

			break;
		}
		case 2: {

			break;
		}
		case 3: {
			WND_API_CreateMainWnd(hWnd, WND_TYPE_SET_E);
			//SET_WindowCreate(hWnd, WND_TYPE_SET_E);
			break;
		}
		case 4: {
			//SET_WindowCreate(hWnd, WND_TYPE_SET_E);

			break;
		}
		case 5: {

			break;
		}
	}
	return 0;
}




int MINI_SET_MNG_WindowCreateMenu(WND_API_HANDLE_S *pstMainWnd, HWND hWnd)
{
	int s32Num;
	RECT rcMargin;
	IVITEMINFO ivii;
	static int i = 0;
	HDC u32DcMenu;

	if(NULL == pstMainWnd) {
		QLOG(ERR, "窗口结构体为空\n");
		return -1;
	}

	MINI_SET_MNG_WND_S *pstMenuWnd = (MINI_SET_MNG_WND_S *)pstMainWnd->stAttr.pAri;
	/* 菜单*/

	for (s32Num=0; s32Num < MINI_DEV_MNG_ICON_NUM; s32Num++) {
        LoadBitmap(HDC_SCREEN, &pstMenuWnd->stIconMenu[s32Num], pstMenuWnd->s8MenuPath[s32Num]);
    }

	pstMenuWnd->u32WndMenu =CreateWindow(CTRL_ICONVIEW, "",
											//WS_BORDER | WS_CHILD | WS_VISIBLE | WS_THICKFRAME,
											WS_CHILD | WS_VISIBLE,
											IDC_DEV_SET_MENU,
											pstMainWnd->stAttr.s32WndWidth/8,
											pstMainWnd->stAttr.s32WndHeight/6,
											(pstMainWnd->stAttr.s32WndWidth*5)/6,
											(pstMainWnd->stAttr.s32WndHeight*3)/4,
											hWnd,//pstMainWnd->u32MainWnd,
											0);


	pstMenuWnd->u32WndQuit =CreateWindow(CTRL_ICONVIEW, "",
											//WS_BORDER | WS_CHILD | WS_VISIBLE | WS_THICKFRAME,
											WS_CHILD | WS_VISIBLE,
											IDC_DEV_SET_QUIT,
											(pstMainWnd->stAttr.s32WndWidth*9)/10,
											(pstMainWnd->stAttr.s32WndHeight*0)/8,
											(pstMainWnd->stAttr.s32WndWidth*1)/10,
											(pstMainWnd->stAttr.s32WndHeight*1)/8,
											hWnd,//pstMainWnd->u32MainWnd,
											0);


	rcMargin.left = 0;
	rcMargin.top = 0;
	rcMargin.right = 0;
	rcMargin.bottom = 0;
	//SendMessage (pstMenuWnd->u32WndMenu, IVM_SETMARGINS, 0, (LPARAM)&rcMargin);
	//SendMessage (pstMenuWnd->u32WndMenu, IVM_SETCONTRANGE, 0, (LPARAM)&rcMargin);

	SetWindowBkColor(pstMenuWnd->u32WndMenu, COLOR_black);
	SetWindowBkColor(pstMenuWnd->u32WndQuit, COLOR_black);

	QLOG(TDBG, "创建图标\n");



	u32DcMenu = GetDC(pstMenuWnd->u32WndMenu);
	//SetTextColor(u32DcMenu, COLOR_yellow);
	//SetNotificationCallback (pstMenuWnd->u32WndMenu, MenuNotifProc);

	/* 设置图标控件大小*/
	SendMessage (pstMenuWnd->u32WndMenu, IVM_SETITEMSIZE,
				pstMainWnd->stAttr.s32WndWidth/4,
				pstMainWnd->stAttr.s32WndHeight/4+pstMainWnd->stAttr.s32WndHeight/10);

	for (i = 0; i < MINI_DEV_MNG_ICON_NUM-1; i++) {
		memset (&ivii, 0, sizeof(IVITEMINFO));
		ivii.bmp = &pstMenuWnd->stIconMenu[i];
		ivii.nItem = i;
		ivii.label = NULL;
		ivii.addData = (DWORD)0;
		SendMessage (pstMenuWnd->u32WndMenu, IVM_ADDITEM, 0, (LPARAM)&ivii);
	}



	SendMessage (pstMenuWnd->u32WndQuit, IVM_SETITEMSIZE,
				pstMainWnd->stAttr.s32WndWidth/10, pstMainWnd->stAttr.s32WndHeight/8);
	rcMargin.left = 0;
	rcMargin.top = 0;
	rcMargin.right = 0;
	rcMargin.bottom = 0;
	SendMessage (pstMenuWnd->u32WndQuit, IVM_SETMARGINS, 0, (LPARAM)&rcMargin);
	memset (&ivii, 0, sizeof(IVITEMINFO));
	ivii.bmp = &pstMenuWnd->stIconMenu[6];
	ivii.nItem = 0;
	ivii.label = NULL;
	ivii.addData = (DWORD)0;
	SendMessage (pstMenuWnd->u32WndQuit, IVM_ADDITEM, 0, (LPARAM)&ivii);

	ShowWindow (pstMenuWnd->u32WndMenu, SW_SHOW);
	ShowWindow (pstMenuWnd->u32WndQuit, SW_SHOW);

	//pstMenuWnd->bDisplayMenu =false;
	ReleaseDC(u32DcMenu);


	return 0;
}


static int MINI_SET_MNG_WND_WindowProc(HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
{
    HDC hdc;
	char s8Utf8[64];

	snprintf(s8Utf8, sizeof(s8Utf8), "你好世界你好123456");
	WND_API_HANDLE_S * pstMainWnd = NULL;
	//pstMainWnd = WND_API_GetMainWnd(WND_TYPE_DEV_MNG_E);
	pstMainWnd = (WND_API_HANDLE_S *)GetWindowAdditionalData(hWnd);
	MINI_SET_MNG_WND_S *pstMenuWnd = NULL;

	if(NULL == pstMainWnd) {
		QLOG(ERR, "未找到主界面\n");
		return -1;
	}

	pstMenuWnd = (MINI_SET_MNG_WND_S *)pstMainWnd->stAttr.pAri;
	if(NULL == pstMenuWnd) {
		QLOG(ERR, "未找到主界面私有属性\n");
		return -1;
	}


    switch (message) {
		case MSG_CREATE: {
			MINI_SET_MNG_WindowCreateMenu(pstMainWnd, hWnd);
		}
		break;
		case MSG_INITDIALOG:

		break;
		case MSG_COMMAND:
		{
			int id = LOWORD (wParam);
			int code = HIWORD (wParam);
			int sel;
			switch (id) {
				case IDC_DEV_SET_MENU:
					if (code == IVN_CLICKED) {

						sel = SendMessage (pstMenuWnd->u32WndMenu, IVM_GETCURSEL, 0, 0);
						QLOG(TDBG, "clicking %d wParam[0x%x]\n", sel, wParam);
						//SendMessage (pstMenuWnd->u32WndMenu, IVM_SELECTITEM, sel, TRUE);
						MINI_SET_MNG_WNG_Switch(hWnd, sel);
					}
				break;
				case IDC_DEV_SET_QUIT:
					if (code == IVN_CLICKED) {

						sel = SendMessage (pstMenuWnd->u32WndQuit, IVM_GETCURSEL, 0, 0);
						QLOG(TDBG, "clicking quit %d wParam[0x%x]\n", sel, wParam);
						//SendMessage (pstMenuWnd->u32WndQuit, IVM_SELECTITEM, sel, TRUE);
						WND_API_DestroyMainWnd(WND_TYPE_MAIN_E,	WND_TYPE_DEV_MNG_E);
/*
						DestroyWindow(pstMenuWnd->u32WndQuit);
						DestroyWindow(pstMenuWnd->u32WndMenu);
						MINI_API_DestroyMainWindow(hWnd);
						ShowWindow (WND_API_GetMainWnd(WND_TYPE_MAIN_E)->u32MainWnd, SW_SHOW);
						UpdateWindow(WND_API_GetMainWnd(WND_TYPE_MAIN_E)->u32MainWnd, TRUE);
						//WND_MINI_SwitchProc(hWnd, sel);
						*/
					}
				break;
			}

		}
		break;
        case MSG_PAINT:
			//QLOG(TDBG, "创建窗口\n");
           	hdc = MINI_API_BeginPaint(hWnd);

            MINI_API_EndPaint (hWnd, hdc);
        	return 0;
        case MSG_CLOSE:
			QLOG(TDBG, "结束主界面\n");
			//DestroyLogFont(pstFont);
            MINI_API_DestroyMainWindow (hWnd);
            MINI_API_PostQuitMessage (hWnd);
            return 0;
    }

    return DefaultMainWinProc(hWnd, message, wParam, lParam);
}








void * MINI_SET_MNG_WindowCreate(void *pArg)
{

	WND_API_CreateFullScreenMainWnd((WND_API_HANDLE_S *)pArg,//pstMainWnd,
										WS_VISIBLE | WS_BORDER,
										WS_EX_NONE,
										MINI_SET_MNG_WND_WindowProc, COLOR_black, SW_SHOWNORMAL);
	return NULL;
}


int WND_SET_MNG_DestroyMainWnd(WND_API_HANDLE_S *pstMainWnd)
{
	MINI_SET_MNG_WND_S *pstMenuWnd = NULL;

	if(NULL == pstMainWnd) {
		QLOG(ERR, "未找到主界面\n");
		return -1;
	}

	pstMenuWnd = (MINI_SET_MNG_WND_S *)pstMainWnd->stAttr.pAri;
	if(NULL == pstMenuWnd) {
		QLOG(ERR, "未找到主界面私有属性\n");
		return -1;
	}

	DestroyWindow(pstMenuWnd->u32WndQuit);
	DestroyWindow(pstMenuWnd->u32WndMenu);
	DestroyMainWindow(pstMainWnd->stAttr.u32MainWnd);

	//UpdateWindow(WND_API_GetMainWnd(WND_TYPE_MAIN_E)->u32MainWnd, TRUE);
	return 0;
}











#endif

























static int WND_DEV_MNG_Proc(HWND u32Wnd, int s32Message, WPARAM u32Param, LPARAM u64Param)
{
    HDC hdc;
	//char s8Utf8[64];
	WND_WIDGET_S *pstWnd = (WND_WIDGET_S *)GetWindowAdditionalData(u32Wnd);
	int s32Num;
	WND_WIDGET_S *pstCtrl = NULL;


    switch (s32Message) {
		case MSG_CREATE: {
			pstWnd->stCommon.stAttr.u32WndId = u32Wnd;
			if(pstWnd) {
				for(s32Num = 0; s32Num < pstWnd->s32WidgetNum; s32Num++) {
					pstCtrl = &pstWnd->pstWidget[s32Num];
					//pstCtrl->stCommon.stAttr.u32ParentWndId = pstWnd->stCommon.stAttr.u32WndId;
					WND_WIDGET_Create(&pstWnd->pstWidget[s32Num], pstWnd->stCommon.stAttr.u32WndId);
				}
			}
		}
		break;
		case MSG_INITDIALOG:

		break;
		case MSG_COMMAND:

		break;
        case MSG_PAINT:
			//QLOG(TDBG, "创建窗口\n");
           	hdc = BeginPaint(u32Wnd);

            EndPaint (u32Wnd, hdc);
        	return 0;
        case MSG_CLOSE:
			QLOG(TDBG, "结束主界面\n");
			//DestroyLogFont(pstFont);
            DestroyMainWindow (u32Wnd);
            PostQuitMessage (u32Wnd);
            return 0;
    }

    return DefaultMainWinProc(u32Wnd, s32Message, u32Param, u64Param);
}




int WND_DEV_MNG_CallBackVideoSearch(HWND u32Wnd, int message, WPARAM wParam, LPARAM lParam)
{
	QLOG(TDBG, "录像搜索\n");
	//WND_WIDGET_FlushDoublePictureButtonCursel(u32Wnd);
	return 0;
}

int WND_DEV_MNG_CallBackStaSearch(HWND u32Wnd, int message, WPARAM wParam, LPARAM lParam)
{
	QLOG(TDBG, "状态查询\n");
	//WND_WIDGET_FlushDoublePictureButtonCursel(u32Wnd);
	return 0;
}

int WND_DEV_MNG_CallBackLogSearch(HWND u32Wnd, int message, WPARAM wParam, LPARAM lParam)
{
	QLOG(TDBG, "日志查询\n");
	//WND_WIDGET_FlushDoublePictureButtonCursel(u32Wnd);
	return 0;
}

int WND_DEV_MNG_CallBackSet(HWND u32Wnd, int message, WPARAM wParam, LPARAM lParam)
{
	QLOG(TDBG, "设置\n");
	//WND_WIDGET_FlushDoublePictureButtonCursel(u32Wnd);
	WND_HANDLE_CreateMainWnd(MAIN_WND_TYPE_SET_E);
	//MAIN_WND_Create(&stGlbMainModule, MAIN_WND_TYPE_SET_E,HWND_DESKTOP,COLOR_black);
	return 0;
}

int WND_DEV_MNG_CallBackITS(HWND u32Wnd, int message, WPARAM wParam, LPARAM lParam)
{
	QLOG(TDBG, "智能交通\n");
	//WND_WIDGET_FlushDoublePictureButtonCursel(u32Wnd);
	return 0;
}

int WND_DEV_MNG_CallBackReset(HWND u32Wnd, int message, WPARAM wParam, LPARAM lParam)
{
	QLOG(TDBG, "注销\n");
	//WND_WIDGET_FlushDoublePictureButtonCursel(u32Wnd);
	return 0;
}

int WND_DEV_MNG_CallBackReturn(HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
{
	QLOG(TDBG, "返回------------------------\n");
	//MAIN_WND_Destroy(&stGlbMainModule, MAIN_WND_TYPE_DEV_MNG_E);
	WND_HANDLE_Destroy(MAIN_WND_TYPE_DEV_MNG_E);
	WND_WIDGET_S * pstWnd = WND_HANDLE_GetMainWnd(MAIN_WND_TYPE_MAIN_E);
	ShowWindow(pstWnd->stCommon.stAttr.u32WndId, SW_SHOWNORMAL);
	QLOG(TDBG, "返回------------------------ok\n");
	return 0;
}







WND_WIDGET_S stGlbDevMngChildMenuWnd[] = {


	{
		.enType = WND_WIDGET_TYPE_STATIC_PICTURE_E,
		.unPrivate = {
			.stStaticPicture= {
				.s8MapPath = "share/res/png/dev_set/录像查询.png",
				.bNotify = true,
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "录像查询",
				//.u32WndId = 0,
				//.u32Group = 2,
				//.u32Id = 5560,
				.u32WndX = (UI_COORD_MAX*1)/6,
				.u32WndY = (UI_COORD_MAX*1)/6,
				.u32WndWidth = (UI_COORD_MAX*2)/6,
				.u32WndHeight = (UI_COORD_MAX*2)/6,
				.enBkColor = UI_COLOR_TRANSPARENT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				.CallBack = WND_DEV_MNG_CallBackVideoSearch,
			},
		},
	},

	{
		.enType = WND_WIDGET_TYPE_STATIC_PICTURE_E,
		.unPrivate = {
			.stStaticPicture= {
				.s8MapPath = "share/res/png/dev_set/状态查询.png",
				.bNotify = true,
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "状态查询",
				//.u32WndId = 0,
				//.u32Group = 2,
				//.u32Id = 5560,
				.u32WndX = (UI_COORD_MAX*1)/6,
				.u32WndY = (UI_COORD_MAX*1)/6,
				.u32WndWidth = (UI_COORD_MAX*2)/6,
				.u32WndHeight = (UI_COORD_MAX*2)/6,
				.enBkColor = UI_COLOR_TRANSPARENT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				.CallBack = WND_DEV_MNG_CallBackStaSearch,
			},
		},
	},


	{
		.enType = WND_WIDGET_TYPE_STATIC_PICTURE_E,
		.unPrivate = {
			.stStaticPicture= {
				.s8MapPath = "share/res/png/dev_set/日志查询.png",
				.bNotify = true,
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "日志查询",
				//.u32WndId = 0,
				//.u32Group = 2,
				//.u32Id = 5560,
				.u32WndX = (UI_COORD_MAX*1)/6,
				.u32WndY = (UI_COORD_MAX*1)/6,
				.u32WndWidth = (UI_COORD_MAX*2)/6,
				.u32WndHeight = (UI_COORD_MAX*2)/6,
				.enBkColor = UI_COLOR_TRANSPARENT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				.CallBack = WND_DEV_MNG_CallBackLogSearch,
			},
		},
	},


	{
		.enType = WND_WIDGET_TYPE_STATIC_PICTURE_E,
		.unPrivate = {
			.stStaticPicture= {
				.s8MapPath = "share/res/png/dev_set/设置.png",
				.bNotify = true,
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "设置",
				//.u32WndId = 0,
				//.u32Group = 2,
				//.u32Id = 5560,
				.u32WndX = (UI_COORD_MAX*1)/6,
				.u32WndY = (UI_COORD_MAX*1)/6,
				.u32WndWidth = (UI_COORD_MAX*2)/6,
				.u32WndHeight = (UI_COORD_MAX*2)/6,
				.enBkColor = UI_COLOR_TRANSPARENT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				.CallBack = WND_DEV_MNG_CallBackSet,
			},
		},
	},


	{
		.enType = WND_WIDGET_TYPE_STATIC_PICTURE_E,
		.unPrivate = {
			.stStaticPicture= {
				.s8MapPath = "share/res/png/dev_set/智能交通.png",
				.bNotify = true,
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "智能交通",
				//.u32WndId = 0,
				//.u32Group = 2,
				//.u32Id = 5560,
				.u32WndX = (UI_COORD_MAX*1)/6,
				.u32WndY = (UI_COORD_MAX*1)/6,
				.u32WndWidth = (UI_COORD_MAX*2)/6,
				.u32WndHeight = (UI_COORD_MAX*2)/6,
				.enBkColor = UI_COLOR_TRANSPARENT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				.CallBack = WND_DEV_MNG_CallBackITS,
			},
		},
	},

	{
		.enType = WND_WIDGET_TYPE_STATIC_PICTURE_E,
		.unPrivate = {
			.stStaticPicture= {
				.s8MapPath = "share/res/png/dev_set/注销.png",
				.bNotify = true,
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "注销",
				//.u32WndId = 0,
				//.u32Group = 2,
				//.u32Id = 5560,
				.u32WndX = (UI_COORD_MAX*1)/6,
				.u32WndY = (UI_COORD_MAX*1)/6,
				.u32WndWidth = (UI_COORD_MAX*2)/6,
				.u32WndHeight = (UI_COORD_MAX*2)/6,
				.enBkColor = UI_COLOR_TRANSPARENT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				.CallBack = WND_DEV_MNG_CallBackReset,
			},
		},
	},
};



WND_WIDGET_S stGlbDevMngWndCtrl[] = {



	{
		.enType = WND_WIDGET_TYPE_CTRL_SETS_E,
		.unPrivate = {
			.stCtrlSets = {
				.s32Direction = 2,
				.s32Left = (UI_COORD_MAX*1)/120,						/* 左 端空隙的距离*/
				.s32Right = (UI_COORD_MAX*1)/120,						/* 右 端空隙的距离*/
				.s32Top = (UI_COORD_MAX*1)/60,							/* 上 端空隙的距离*/
				.s32Bottom = (UI_COORD_MAX*1)/50,					/* 下 端空隙的距离*/
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "控件集合",
				.u32Group = WIDGET_GRP_MAIN_MENU_E,
				.u32Id = 5568,
				.u32WndX = (UI_COORD_MAX*1)/8,
				.u32WndY = (UI_COORD_MAX*2)/10,
				.u32WndWidth = (UI_COORD_MAX*6)/8,
				.u32WndHeight = (UI_COORD_MAX*6)/10,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				//.CallBack = WND_MAIN_MenuProc,
			},
			//WND_STA_S stSta;
		},

		.pstWidget = stGlbDevMngChildMenuWnd,
		.s32WidgetNum = sizeof(stGlbDevMngChildMenuWnd) / sizeof(stGlbDevMngChildMenuWnd[0]),
	},



	{
		.enType = WND_WIDGET_TYPE_STATIC_PICTURE_E,
		.unPrivate = {
			.stStaticPicture= {
				.s8MapPath = "share/res/png/dev_set/返回点击状态.png",
				.bNotify = true,
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "返回",
				//.u32WndId = 0,
				//.u32Group = 2,
				//.u32Id = 5560,
				.u32WndX = (UI_COORD_MAX*7)/8,
				.u32WndY = (UI_COORD_MAX*0)/10 + (UI_COORD_MAX*1) / 20,
				.u32WndWidth = (UI_COORD_MAX*1)/8,
				.u32WndHeight = (UI_COORD_MAX*1)/10,
				.enBkColor = UI_COLOR_TRANSPARENT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				.CallBack = WND_DEV_MNG_CallBackReturn,
			},
		},
	},

#if 0
	{
		.enType = WND_WIDGET_TYPE_BUTTON_E,
		.stCommon = {
			.stAttr = {
				.s8Name = "录像搜索",
				.u32WndId = 0,
				.u32Group = 0,
				//.u32ParentWndId = HWND_DESKTOP,
				.u64Style = WS_VISIBLE | WS_BORDER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = 5566,
				.u32Id = 0,
				.u32WndX = (UI_COORD_MAX * 1)/5,
				.u32WndY = (UI_COORD_MAX * 1)/4,
				.u32WndWidth = (UI_COORD_MAX * 1)/5,
				.u32WndHeight = (UI_COORD_MAX * 1)/4,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
			},
			.stFops = {
				.CallBack = WND_DEV_MNG_CallBackVideoSearch,
			},
			//WND_STA_S stSta;
		},

		//.pstWidget = stGlbMainWndCtrl,
		//.s32WidgetNum = sizeof(stGlbMainWndCtrl) / sizeof(stGlbMainWndCtrl[0]),
	},
	{
		.enType = WND_WIDGET_TYPE_BUTTON_E,
		.stCommon = {
			.stAttr = {
				.s8Name = "状态查询",
				.u32WndId = 0,
				.u32Group = 0,
				//.u32ParentWndId = HWND_DESKTOP,
				.u64Style = WS_VISIBLE | WS_BORDER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = 5566,
				.u32Id = 0,
				.u32WndX = (UI_COORD_MAX * 2)/5,
				.u32WndY = (UI_COORD_MAX * 1)/4,
				.u32WndWidth = (UI_COORD_MAX * 1)/5,
				.u32WndHeight = (UI_COORD_MAX * 1)/4,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
			},
			.stFops = {
				.CallBack = WND_DEV_MNG_CallBackStaSearch,
			},
			//WND_STA_S stSta;
		},

		//.pstWidget = stGlbMainWndCtrl,
		//.s32WidgetNum = sizeof(stGlbMainWndCtrl) / sizeof(stGlbMainWndCtrl[0]),
	},
	{
		.enType = WND_WIDGET_TYPE_BUTTON_E,
		.stCommon = {
			.stAttr = {
				.s8Name = "日志查询",
				.u32WndId = 0,
				.u32Group = 0,
				//.u32ParentWndId = HWND_DESKTOP,
				.u64Style = WS_VISIBLE | WS_BORDER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = 5566,
				.u32Id = 0,
				.u32WndX = (UI_COORD_MAX * 3)/5,
				.u32WndY = (UI_COORD_MAX * 1)/4,
				.u32WndWidth = (UI_COORD_MAX * 1)/5,
				.u32WndHeight = (UI_COORD_MAX * 1)/4,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
			},
			.stFops = {
				.CallBack = WND_DEV_MNG_CallBackLogSearch,
			},
			//WND_STA_S stSta;
		},

		//.pstWidget = stGlbMainWndCtrl,
		//.s32WidgetNum = sizeof(stGlbMainWndCtrl) / sizeof(stGlbMainWndCtrl[0]),
	},
	{
		.enType = WND_WIDGET_TYPE_BUTTON_E,
		.stCommon = {
			.stAttr = {
				.s8Name = "设置",
				.u32WndId = 0,
				.u32Group = WIDGET_GRP_MAIN_MENU_E,
				//.u32ParentWndId = HWND_DESKTOP,
				.u64Style = WS_VISIBLE | WS_BORDER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = 5566,
				.u32Id = 0,
				.u32WndX = (UI_COORD_MAX * 1)/5,
				.u32WndY = (UI_COORD_MAX * 2)/4,
				.u32WndWidth = (UI_COORD_MAX * 1)/5,
				.u32WndHeight = (UI_COORD_MAX * 1)/4,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
			},
			.stFops = {
				.CallBack = WND_DEV_MNG_CallBackSet,
			},
			//WND_STA_S stSta;
		},

		//.pstWidget = stGlbMainWndCtrl,
		//.s32WidgetNum = sizeof(stGlbMainWndCtrl) / sizeof(stGlbMainWndCtrl[0]),
	},
	{
		.enType = WND_WIDGET_TYPE_BUTTON_E,
		.stCommon = {
			.stAttr = {
				.s8Name = "智能交通",
				.u32WndId = 0,
				.u32Group = 0,
				//.u32ParentWndId = HWND_DESKTOP,
				.u64Style = WS_VISIBLE | WS_BORDER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = 5566,
				.u32Id = 0,
				.u32WndX = (UI_COORD_MAX * 2)/5,
				.u32WndY = (UI_COORD_MAX * 2)/4,
				.u32WndWidth = (UI_COORD_MAX * 1)/5,
				.u32WndHeight = (UI_COORD_MAX * 1)/4,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
			},
			.stFops = {
				.CallBack = WND_DEV_MNG_CallBackITS,
			},
			//WND_STA_S stSta;
		},

		//.pstWidget = stGlbMainWndCtrl,
		//.s32WidgetNum = sizeof(stGlbMainWndCtrl) / sizeof(stGlbMainWndCtrl[0]),
	},
	{
		.enType = WND_WIDGET_TYPE_BUTTON_E,
		.stCommon = {
			.stAttr = {
				.s8Name = "注销",
				.u32WndId = 0,
				.u32Group = 0,
				//.u32ParentWndId = HWND_DESKTOP,
				.u64Style = WS_VISIBLE | WS_BORDER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = 5566,
				.u32Id = 0,
				.u32WndX = (UI_COORD_MAX * 3)/5,
				.u32WndY = (UI_COORD_MAX * 2)/4,
				.u32WndWidth = (UI_COORD_MAX * 1)/5,
				.u32WndHeight = (UI_COORD_MAX * 1)/4,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
			},
			.stFops = {
				.CallBack = WND_DEV_MNG_CallBackReset,
			},
			//WND_STA_S stSta;
		},

		//.pstWidget = stGlbMainWndCtrl,
		//.s32WidgetNum = sizeof(stGlbMainWndCtrl) / sizeof(stGlbMainWndCtrl[0]),
	},

	{
			.enType = WND_WIDGET_TYPE_BUTTON_E,
			.stCommon = {
				.stAttr = {
					.s8Name = "返回",
					.u32WndId = 0,
					.u32Group = 0,
					//.u32ParentWndId = HWND_DESKTOP,
					.u64Style = WS_VISIBLE | WS_BORDER,
					.u64ExStyle = WS_EX_NONE,
					.u32Id = 5566,
					.u32Id = 0,
					.u32WndX = (UI_COORD_MAX * 4)/5,
					.u32WndY = (UI_COORD_MAX * 0)/4,
					.u32WndWidth = (UI_COORD_MAX * 1)/5,
					.u32WndHeight = (UI_COORD_MAX * 1)/4,
					.enBkColor = UI_COLOR_DEFAULT_E,
					.bShowNow = true,
				},
				.stFops = {
					.CallBack = WND_DEV_MNG_CallBackReturn,
				},
				//WND_STA_S stSta;
			},

			//.pstWidget = stGlbMainWndCtrl,
			//.s32WidgetNum = sizeof(stGlbMainWndCtrl) / sizeof(stGlbMainWndCtrl[0]),
		},

#endif
};



















WND_WIDGET_S stGlbDevMngWindow = {
	.enType = WND_WIDGET_TYPE_MAIN_E,
	//WND_WIDGET_ATTR_U unWidget;
	.stCommon = {
		.stAttr = {
			.s8Name = "设备管理",
			.u32WndId = 0,
			.u32Group = MAIN_WND_TYPE_DEV_MNG_E,
			//.u32ParentWndId = HWND_DESKTOP,
			.u64Style = WS_VISIBLE | WS_BORDER,
			.u64ExStyle = WS_EX_NONE,
			.u32Id = 5,
			.u32WndX = 0,
			.u32WndY = 0,
			.u32WndWidth = UI_COORD_MAX,
			.u32WndHeight = UI_COORD_MAX,
			//.enBkColor = UI_COLOR_BLACK_E,
			.enBkColor = UI_COLOR_DEFAULT_E,
			.bShowNow = true,
		},
		.stFops = {
			.CallBack = WND_DEV_MNG_Proc,
		},
		//WND_STA_S stSta;
	},

	.pstWidget = stGlbDevMngWndCtrl,
	.s32WidgetNum = sizeof(stGlbDevMngWndCtrl) / sizeof(stGlbDevMngWndCtrl[0]),

};

